package com.drcoffee.drcoffeemall.service;

import com.drcoffee.drcoffeemall.entry.*;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Map;

public interface UserService {

    /* 校验账号 */
    Result verifyAccount(String account);

    /* 注册用户 */
    Result register(User user) throws GeneralSecurityException;

    /* 设置为默认地址 */
    Result setDefaultAddress(Integer id, String account);

    /* 登录校验 */
    Result accountLogin(User user);

    /* 验证码登录 */
    ResponseEntity<Object> codeLogin(String key, String code, Integer type);

    /* 根据账号查询用户信息 */
    public Result getUserByAccount(String account);

    /* 删除Token */
    boolean removeToken(String Token);

    /* 更新Token */
    void renewalToken(String Token);

    /* 验证Token */
    boolean verifyToken(String Token, ExceptionRecord exceptionRecord);

    /* 判断是否为管理员 */
    Map<String, Object> allPermissionCheck(String token);


    /* 校验邮箱验证码 */
    boolean verifyEmailCode(String email, String emailCode);

    /* 修改用户信息 */
    Map<String, Object> uploadUser(User user);

    /* 修改用户头像 */
    Result uploadUserPhoto(Integer id, String val1, String val2);


    /* 登录验证码 */
    Result sendLoginCode(String val);

    /* 发送邮箱验证码(找回密码) */
    boolean sendEmailCode(String email, Integer type);

    ResponseEntity<Object> isExist(String val);

    /* 找回密码 */
    Result retrievePass(Map<String, Object> reval) throws GeneralSecurityException;

    /* 更改密码 */
    Result changePass(Map<String, Object> val);

    Result changeEmPh(String Token, String v1, String v2, String v3);

    Result changeName(String Token, String newName);

    Result setAccount(User user);

    Result invitationCheck(Integer code);

    Result sendPhoneCode(String phone);

    Result verifyCode(String v1, String v2, String v3);

    Result putFeedback(String Token, Feedback feedback);

    Result getAlterFirmPD(String account);

    Result addFirmAlter(FirmAlter firmAlter);

    ResponseEntity<Integer> haveRegistered(String email);

}
